#pragma once

#include <vector>
#include <map>
#include <iostream>

struct Mouse
{
	enum Btn
	{
		_left = 0,
		_right,
		_middle,
		_side_back,
		_side_front

	};
	struct Vec2
	{
		double  x, y;
	};

	Mouse();

	Vec2 currentPos, scrollDelta;
	struct Event
	{
		int key, action, mode;
	};

	bool states[10];

	bool MousePressing(int i);
	std::vector<Event> events;

	std::vector<Event> Events() const;
	Vec2 CurrenPos() const;
	Vec2 ScrollDelta() const;

	void OnScroll(double x, double y);
	void OnCursorPos(double x, double y);
	void OnMouse(int key, int action, int mode);

	bool MouseEvent(int key, int mode, int action);

	bool MouseDown(int key, int mode);
	bool MouseRelease(int key, int mode);

	void OnClearEvent();

};